package com.heima.test1;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;
import java.util.Scanner;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;


//需求: 编写5个线程,第一个线程从1加到10,第二个线程从11加到20……第5个线程从41加到50;最后每个线程的结果相加
public class Demo01 {
    int a = 10;
    int b = 10;
    int c = 20;
    public static void main(String[] args) throws ExecutionException, InterruptedException, IOException {
        Scanner sc = new Scanner(System.in);
        while (true) {
            String name = sc.next();
            String pwd = sc.next();

            Properties prop = new Properties();
            FileReader fr = new FileReader("config.properties");
            prop.load(fr);
            String username = prop.getProperty("username");
            String password = prop.getProperty("password");
            String color = prop.getProperty("color");
            if (name.equals(username) && password.equals(pwd)) {
                if (color.equals("black")) {
                    System.out.println(name + "登录成功 信息如下:\n" + prop);
                } else {
                    System.err.println(name + "登录成功 信息如下:\n" + prop);
                }
                break;
            }
            if (color.equals("black")) {
                System.out.println("登录失败用户名密码不对");
            } else {
                System.out.println("登录失败用户名密码不对");
            }
        }

    }
}
